<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
//中间件群组
Route::group(['middleware' => 'login'], function ()
{
//后台主页

Route::get('/', function () {
    return view('welcome');
});
//用户管理
Route::get('/admin/index','Admin\IndexController@index');

Route::get('/admin/user/add',"Admin\UserController@add");
Route::post('/admin/user/insert',"Admin\UserController@insert");
Route::get('/admin/user/index','Admin\UserController@index');
Route::post('/admin/user/ajaxUpdate','Admin\UserController@ajaxUpdate');
Route::post('/admin/user/ajaxName','Admin\UserController@ajaxName');
Route::get('/admin/user/edit/{id}','Admin\UserController@edit');
Route::post('/admin/user/update','Admin\UserController@update');
Route::get('/admin/user/delete/{id}','Admin\UserController@delete');


//分类管理
//资源控制器
Route::resource('/admin/cate','Admin\CateController');

//商品管理
//隐式控制器
Route::controller('/admin/goods','Admin\GoodsController');
//退出登录
Route::get('/admin/logout','Admin\LoginController@logout');


});

//登录
Route::get('/admin/login','Admin\LoginController@login');
Route::post('/admin/dologin','Admin\LoginController@dologin');

//验证码
Route::get('/kit/captcha/{tmp}','Admin\KitController@captcha');

//找回密码
Route::get('/admin/reset/forget','Admin\ResetController@forget');
Route::post('/admin/reset/sendemail','Admin\ResetController@sendemail');
Route::get('/admin/reset/inputpass/id/{id}/token/{token}','Admin\ResetController@inputpass');
Route::post('admin/reset/updatepass','Admin\ResetController@updatepass');
Route::get('admin/reset/info','Admin\ResetController@info');
// Route::get('admin/reset/success','Admin\ResetController@success');

